package com.jse.tpl.fn;

import com.jse.tpl.Context;
import com.jse.tpl.Function;
import com.jse.tpl.exception.TplException;

public class Json implements Function
{
	String template = "<script>console.log(TEMPLATE);</script>";

	@Override
	public Object call(Object[] paras, Context ctx)
	{
		Object o = paras[0];
		String json;
		try
		{
			json = com.jse.util.Json.toJson(o);
		}

		catch (Exception e)
		{
			throw new TplException(TplException.NATIVE_CALL_EXCEPTION, "BTJsonTool 序列化对象出错",e);

		}
		return json;

	}

}
